home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 1.9 KB | 83 lines | [TEXT/MPS ] |
- // UMouseInfo.cp
- // Copyright © 1992 by Apple Computer, Inc. All rights reserved.
- // Kent Sandvik DTS
- // This file contains the basic TMapApplication member functions
- // Version Info (latest first):
- //
- // <1> khs 1.0 First final version
- // <2> khs 1.0.1 Fixed a memory leak in TMapApplication::GetSleepValue()
-
-
- // INCLUDES
-
- #ifndef __MOUSEINFO__
- #include "UMouseInfo.h" // class definitions
- #endif
-
- extern RgnHandle gtempRgn;
-
-
- // Empty constructor - for avoiding ptabs in global data space
- #pragma segment ARes
- TMapApplication::TMapApplication()
- {
- }
-
-
- // Initialize the Application object
- #pragma segment AInit
- pascal void TMapApplication::IMapApplication(OSType fileType,
- OSType creator)
- {
- inherited::IApplication(fileType, creator);
-
- if (gDeadStripSuppression)
- macroDontDeadStrip(TAppFrameAdorner);
-
- RegisterStdType("TAppFrameAdorner", 'afra');// register adorner types
- }
-
-
- // Create a new TDocument from the class
- #pragma segment AOpen
- pascal TDocument* TMapApplication::DoMakeDocument(CommandNumber/* itsCmdNumber */,
- TFile*/* itsFile */ )
- {
- TMouseDocument * aMouseDocument = new TMouseDocument;
- aMouseDocument->IMouseDocument();
- return aMouseDocument;
- }
-
-
- // Show our cute About Box with Jeff trying to destroy my portable at Bahia Honda
- #pragma segment AMain
- pascal void TMapApplication::DoAboutBox()
- {
- CreateAboutBox();
- }
-
-
- // Make sleep region small so we will get more mouse events, make this
- // dynamic so we could turn this on off depending if the mouse tracking behavior is active
- #pragma segment MAApplicationRes
- pascal RgnHandle TMapApplication::GetSleepRegion()
- {
- if (gMouseTrackWindow) // we have a floating window tracking mouse movements -> more events needed
- {
- CPoint mousePoint;
-
- GetMouse(mousePoint);
- SetRectRgn(gtempRgn, mousePoint.v, mousePoint.h, mousePoint.v + 1, mousePoint.h + 1);
-
- return gtempRgn;
- }
- else
- return inherited::GetSleepRegion();
- }
-
-
-
-
-
-
-